package com.sun.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestController {

    @RequestMapping(value = "/")
    public String test1(){
        return "index";
    }

    // 模拟数学异常
    @RequestMapping(value = "/testException1")
    public String testException1(){
        int i = 1/0;
        return "index";
    }

    // 模拟其他异常
    @RequestMapping(value = "/testException2")
    public String testException2(){
        int[] arr = new int[3];
        System.out.println(arr[3]);
        return "index";
    }
}
